<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF=8">
    <title></title>
    <script>
      var str = 'fsdfhellosdfslj';
      var re = /hello/;
      window.onload = function() {
        if(re.test(str)) {
          alert("含有");
        } else {
          alert("没有");
        }
      }
    </script>
  </head>
  <body>
  </body>
</html>
